﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MyHealthByDesignWebsite.Models.RegisterModel>" %>

<asp:Content ID="registerTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Register
</asp:Content>

<asp:Content ID="registerContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>My Health Sign-Up</h2>
    <p>
        Use the form below to create a new account. 
    </p>

    <script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
    <script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>

    <% using (Html.BeginForm()) { %>
        <%: Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.") %>
        <div>
            <fieldset>
                <legend>Account Information</legend>

                <div class="editor-label">
                    *<%: Html.LabelFor (m => m.FirstName) %>
                </div>
                <div class="editor-field">
                    <%: Html.TextBoxFor(m => m.FirstName)%>
                    <%: Html.ValidationMessageFor(m => m.FirstName)%>
                </div>
                <div class="editor-label">
                    *<%: Html.LabelFor(m => m.LastName)%>
                </div>
                <div class="editor-field">
                    <%: Html.TextBoxFor(m => m.LastName)%>
                    <%: Html.ValidationMessageFor(m => m.LastName)%>
                </div>
              
                <div class="editor-label">
                    *<%: Html.LabelFor(m => m.Sex) %>
                </div>
                <div class="editor-field">
                    <%: Html.RadioButtonFor(m => m.Sex,"Male")%> Male 
                    <%: Html.RadioButtonFor(m => m.Sex,"Female")%> Female
                    <%: Html.ValidationMessageFor(m => m.Sex)%>
                </div> 
                <div class="editor-label">
                    *<%: Html.LabelFor(m => m.DOB) %> (MM/DD/YYYY)
                </div>
                <div class="editor-field">
                    <%: Html.TextBoxFor(m => m.DOB)%>
                    <%: Html.ValidationMessageFor(m => m.DOB)%>
                </div>
               
                <div class="editor-label">
                    *<%: Html.LabelFor(m => m.Address) %>
                </div>
                <div class="editor-field">
                    <%: Html.TextBoxFor(m => m.Address)%>
                    <%: Html.ValidationMessageFor(m => m.Address)%>
                </div>
                <div class="editor-label">
                    *<%: Html.LabelFor(m => m.City) %>
                </div>
                <div class="editor-field">
                    <%: Html.TextBoxFor(m => m.City)%>
                    <%: Html.ValidationMessageFor(m => m.City)%>
                </div>
                <div class="editor-label">
                    *<%: Html.LabelFor(m => m.State) %>
                </div>
                <div class="editor-field">
                    <%: Html.DropDownListFor(model => model.State, (IEnumerable<SelectListItem>)ViewData["Statelist"])%>
                    <%: Html.ValidationMessageFor(m => m.State)%>
                </div>
                <div class="editor-label">
                    *<%: Html.LabelFor(m => m.Zipcode) %>
                </div>
                <div class="editor-field">
                    <%: Html.TextBoxFor(m => m.Zipcode)%>
                    <%: Html.ValidationMessageFor(m => m.Zipcode)%>
                </div>

                <div class="editor-label">
                    *<%: Html.LabelFor(m => m.Ethnicity) %>
                </div>
                <div class="editor-field">
                    <% foreach (var info in (IEnumerable<SelectListItem>)ViewData["Ethnicity"])
                       { if (info.Text != "Other")
                        {%> 
                            <div><%= Html.CheckBox(info.Text, info.Value) %> <%= info.Text %></div>
                        <% } 
                        }
                      foreach (var info in (IEnumerable<SelectListItem>)ViewData["Ethnicity"])
                      {if (info.Text == "Other")
                       { %>
                       <div><%= Html.CheckBox(info.Text, info.Value) %> <%= info.Text %>
                       – Please specify <%= Html.TextBox("OtherText")%>
                       <% }
                       }%></div>
                        <%: Html.ValidationMessageFor(m => m.Ethnicity)%>
                </div>
                <br />
                <div class="editor-label">
                <b>This information will be used each time you login to My Health by Design:
                </b><br/><br />
                    *<%: Html.LabelFor(m => m.UserName) %> (Please use a valid email address)
                </div>
                <div class="editor-field">
                    <%: Html.TextBoxFor(m => m.UserName) %>
                    <%: Html.ValidationMessageFor(m => m.UserName) %>
                </div>                
                <div class="editor-label">
                    *<%: Html.LabelFor(m => m.Password) %> (<%: Membership.MinRequiredPasswordLength %> - 10 characters, no spaces)
                </div>
                <div class="editor-field">
                    <%: Html.PasswordFor(m => m.Password) %>
                    <%: Html.ValidationMessageFor(m => m.Password) %>
                </div>
                <div class="editor-label">
                    *<%: Html.LabelFor(m => m.ConfirmPassword) %>
                </div>
                <div class="editor-field">
                    <%: Html.PasswordFor(m => m.ConfirmPassword) %>
                    <%: Html.ValidationMessageFor(m => m.ConfirmPassword) %>
                </div>

                <div class="editor-label">
                    <%: Html.LabelFor(m => m.MobilePhone) %>
                </div>
                <div class="editor-field">
                    <%: Html.TextBoxFor(m => m.MobilePhone)%>
                </div>
                              
            </fieldset>
                <p style = "text-align:center">
                    <input type="submit" value="Register" />
                </p>
        </div>
    <% } %>
</asp:Content>
